home *** CD-ROM | disk | FTP | other *** search
- IDEAS FOR USING FFG AND OTHER FREQUENTLY ASKED QUESTIONS
-
- Q: How do I find a file whose name I can't remember but I know it had
- "92" in the name or extension somewhere?
-
- A: ffg *:*92*
-
-
- Q: How do I find a file whose name I can't remember but I know it had
- the words "save this forever" somewhere in the file?"
-
- A: 1. ffg *:* /$"save this forever"
-
- or
-
- 2. ffg *:* /$save=_this=_forever
-
-
- Q: How do I find a file that I know has both 'tax' in the name and '92'
- in the name, but I'm not sure of the order or whether part is in the
- name extension?
-
- A: ffg *:*tax* *92*
-
-
- Q: How to I find files that have info about both "Tom" and "Dick" (or
- "Richard"), but nothing about "Harry"?
-
- A: ffg *:* /$Tom /$Dick,Richard /$=!Harry
-
-
- Q: How can I find a file and then make it's directory the current
- directory?
-
- A: ffg *:filename /g
-
-
- Q: How do I find all files created or modify today without having to
- specify today's date? How can I make backup copies of only those
- files?
-
- A: 1. ffg *:* /dT
- 2. ffg *:* /dT /e"BACKEM %n", where 'BACKEM' is your backup command.
-
-
- Q: How can I find files that were modified during a certain period of
- the day?
-
- A: ffg *:* /t8:00-17:00
-
-
-
- Q: How can a find all configuration files and compress them into an ZIP
- file?
-
- A: 1. To create a list file, then compress the batch:
-
- ffg C:*c*[,n]f[i,]g* /x*.[exe,com,zip] /fp /fs! > c:\cfg\config.lst
- pkzip CFGS.ZIP @config.lst
-
- 2. or, to do it one file at a time:
-
- ffg C:*c*[,n]f[i,]g* /x*.[exe,com,zip] /e"PKZIP -u C:\CFGS.ZIP %n"
-
-
- Q: I want to use FFG to find and back up all my configuration files,
- but the NameMask is so long it makes me exceed the 128 character
- limit for the DOS command line. Is there any way to get around this
- limit?
-
- A: Yes, two things can help. First, you can put some of the parameters
- in the FFGOPT environment variable. It is probably better, though,
- to put the FFG options in a text file all on the first line and then
- redirect FFG input to be from that file. For example, if you put
- your options in a file named CONFIGS.FFG, then you would run FFG as
- follows:
-
- FFG < configs.ffg
-
-
- Q: How can I find all files with a certain extension and rename them to
- have a different extension?
-
- A: 1. ffg *:*.old /e"REN %N %F.new" -- will confirm each one
- 2. ffg *:*.old /e"!REN %N %F.new" -- will do all w/o confirm
-
-
- Q: How can I get a database inventory of all executable programs on my
- computer?
-
- A: ffg *:*.[exe,com] /f, /fs! > C:\DATA\EXELIST.TXT
-
-
- Q: How can I clean up my disk of all temporary and backup files?
-
- A: ffg *:*.[bk*,bak,tmp] /e"DEL %N"
-
-
- Q: How can I delete all files that match a certain description, but
- have an opportunity to confirm for each one whether or not to delete
- it?
-
- A: ffg *:FileMask [Grouping Options] /e"DEL %N"
-
-
- Q: How, in a batch file, can I determine of a directory exists?
-
- A: See "direxist.bat" in UTIL_BAT.ZIP.
-
-
- Q: How can I go find a file in an archive and unarchive it?
-
- A: ffg *:filename /z. /e"UNARC %Z %N" --where UNARC is your unarchive
- utility such as PKUNZIP
-
-
- Q: How can I delete all files that haven't been modified in the last 30
- days?
-
- A: ffg *:* /d-30T /e"DEL %N"
-
-
- Q: How can I audit a business computer for files that appear to be of a
- personal nature?
-
- A: Search for suspicious file names, text contents, hidden files, files
- in hidden directories etc.
-
-
- Q: How can I make all hidden files read-only too?
-
- A: ffg *:* /ah /e"ATTRIB +R %N"
-
-
- Q: How can I find all of my tax files? doc files? help files?
-
- A: See examples in EXAMPLES.FFG and in DEMO_BAT.ZIP
-
-
- Q: How can I go find a file and immediately edit it? view it? search it
- for text?
-
- A: See GoEdit.bat, GoList.bat, GoFind.bat in GO_BAT.ZIP.
-
-
- Q: How can I find all archiving programs and copy them onto a floppy
- disk?
-
- A: ffg *:*[zip,arj,arc,lzh,zoo,pak]*.[exe,com,bat] /e"COPY %N A:"
-
-
-
- Q: How can I archive all files last modified in 1992?
-
- A: ffg *:* /d92 /fp /fs! > c:\1992\1992.lst
- C:
- cd \1992
- pkzip 1992.ZIP @1992.lst
-
-
- Q: How can I find a file that was just created a few minutes ago, when
- I don't know its name?
-
- A: ffg *:* /dT /t5N- -- for last 5 minutes (See also RECENT.BAT)
-
-
- Q: How can I find all files that were installed by Windows 3.1, no
- matter where they are on my computer?
-
- A: ffg *:* /d3/10/92 /t3:10
-
-
- Q: How do I find all files that were last modified/created last weekend?
-
- A: ffg *:* /dSa,Su /d7t-1t
-
-
- Q: How do I find out if there are files in hidden directories?
-
- A: ffg *:* /h.
-
-
- Q: I have a various files with five letter names and no extensions
- (XXXXX.). I want to rename only 1992 files so that they start with
- the year and have my initials as the extension in the form
- 92-XXXXX.TGV. How do I do it?
-
- A: ffg *:?????. /d92 /e"REN %N 92-%F.TGV"
-
-
- Q: How can I change the date/time of a group of files? (needs a dating
- utility)
-
- A: ffg *:FileMask [Grouping Options] /e"NEWDATE %N"
-
- -- where NEWDATE is the dating utility
-
-
- Q: How to I copy, rename, delete, replace etc. a group of files, but
- have an opportunity to verify the operation for each file?
-
- A: See VDELETE.BAT for an example, but all this requires is use of the
- /e execute option, without using the '!' no-confirm option.
-
-
- Q: How can I use FFG to build useful utilities
-
- A: See UTIL-BAT.ZIP
-
-
- Q: I would prefer FFG to search all drives if I don't specify an
- explicit drive, rather than search the current drive. How can I get
- FFG to work way?
-
- A: In the FFGOPT environment variable, include the option "/:_*". If
- you also want to include floppy drives in the search use the option
- "/:_ab*" instead.
-
-
- Q: My computer is connected to a network and sometimes I want to search
- for a file on all drives but I don't want to waste time searching
- network drives. How do I use the "*:" all drives specifier but
- exclude network drives?
-
- A: Configure FFG to skip network drives by setting the "/:!n" option in
- FFGOPT environment variable as in:
-
- set FFGOPT=/:!n
-
-
- Q: I have a CD-ROM drive in my computer. I don't want to waste time
- searching it when I use the '*' "all-drive" specifier. Can I
- configure FFG to avoid searching it?
-
- A: Yes. First, you can explicitly exclude it by using a drive
- specifier "*d:", where D: is CD-ROM drive. To configure FFG to skip
- CD-ROM drives, set the "/:!c" option in the FFGOPT environment
- variable.
-
-
- Q: I do I skip both network and CD-ROM drives when "*:" is used?
-
- A: set FFGOPT=/:!cn
-
-
- Q: My computer is connected to a network and sometimes I want to search
- for a file on all drives but I don't want to waste time searching
- network drives that I can't create files on. Is there a way to use
- the "*:" all drives specifier but exclude these drives?
-
- A: Yes, you can explicitly define which drives should be searched when
- *: is used by using the "/:" option. Do this by setting the option
- in the FFGOPT environment variable as in:
-
- set FFGOPT=/:*c-fz
-
- which will cause "CDEFZ" to be substituted for the '*' when it is
- used in a DriveSpec.
-
-
- Q: How can I make FFG available from a menu program or from Windows,
- yet enter unique search parameters each time it is invoked?
-
- A: To run FFG from other than the DOS prompt, simply run FFG without
- any parameters. FFG will then prompt the user for
- parameters/options. In Windows, you can create a program manager
- icon and enter FFG.EXE as the command.
-
-
- Q: I recently modified my computer configuration such that the disk
- drives are numbered differently. For example, I need to find all
- the files that refer to drive D: and fix them because drive D:
- doesn't exist anymore or is now a different drive letter. How do I
- identify all the files that need to be changed?
-
- A: Use the FFG text-search feature (/$ option). For example, to find
- all batch files that refer to drive D: use the following:
-
- ffg *:*.bat /$D:
-
- But here is how FFG can really help make this task easier by calling
- your editor for each found file to allow you to make the changes:
-
- ffg *:*.bat /$D: /e"edit %n"
-
- If you have a batch-oriented find-and-replace utility you could also
- use it with the /e option to make this chore even easier.
-
-
- Q: I like FFG's text-search feature in conjuction with its ability to
- limit the files searched based on date, size, name etc., but it
- doesn't show me the text in the file as a utility like GREP would.
- Any ideas on how to do this?
-
- A: See the included batch files GOLIST.BAT and GOGREP.BAT for ideas.
- Here is an example using the utility LIST (or GREP). It searches all
- .TXT and .BAT files last modified this year and no larger than 20K
- for the text "happy days" and then lists the file:
-
- ffg *.[txt,bat] /dY /s-20K /$"happy days" /e"list %n"
-
- Q: Could I use FFG to scan files for a virus signature?
-
- A: Yes. Use the /$ option to scan files for a signature (sequence of
- bytes). See the VIRUSCHT.BAT batch file for an example. Here is
- basically what you would do to scan for the "KAOS4" virus which has
- the signature "KAOS4" in the file:
-
- ffg *:*.[com,exe] /$=cKAOS4
-
- Q: My hard disk has some files with spaces in the name. How can I find
- all occurrences of these files?
-
- A: Use the following command line:
-
- ffg "* *"
-
- Note that the ASCII 255 character also appears as a blank space, so
- if you are interested in finding those you can use the following
- command:
-
- ffg * *
-
- where the "blank" is actually a 255 character that was entered by
- pressing and holding the <ALT> key and pressing 255 on the numeric
- keypad, then releasing the <ALT> key. Here quotes are unecessary
- because the 255 character is not a space, which is what makes the
- quotes necesary for the first example.
-